﻿using Dapper.Contrib.Extensions;
using IntelligentGateway.Model.Attribute;
using IntelligentGateway.Model.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IntelligentGateway.Model.Panel
{
    [Serializable]
    [Table("PanelDeviceInfo")]
    public partial class PanelDeviceInfo : IBase
    {
        public int ID
        {
            set; get;
        }
        public string NO
        {
            set; get;
        }
        public string Name
        {
            set; get;
        }
        public string Indent
        {
            set; get;
        }
        public string Memo
        {
            set; get;
        }
        public int DID //暂定主设备ID
        {
            get; set;
        }
        [ForeignRel("StateInfo", "ID", "State")]
        public int? StateID
        {
            set; get;
        }
        [Write(false)]
        [FSelect("StateInfo")]
        public string StateName { get; set; }
        public DateTime? LastStatusTime
        {
            set; get;
        }
        [ForeignRel("TypeInfo", "ID", "Type")]
        public int TypeID { get; set; }
        [Write(false)]
        [FSelect("TypeInfo")]
        public string TypeName { get; set; }

        [Write(false)]
        [Ignore]
        public int? TotalRecords { get; set; }
    }
}
